﻿@{
    ViewBag.Title = "Home Page";
}
@using iDMS.Models
<script type="text/javascript">
    $(function () {
        // Accordion
        $("#accordion").accordion({ header: "h3", autoHeight: false });
        $("a.action").button();
        $('#email').hover(
					function () { $(this).addClass('ui-state-hover'); },
					function () { $(this).removeClass('ui-state-hover'); }
				);
    });
</script>
<div style="display: block; float: right; width: 70%;">
    <div id="accordion">
        @if (User.Identity.IsAuthenticated)
        {
            <div>
                <h3>
                    <a href="#">My iDMS</a></h3>
                <div>
                    @*@if (User.IsInRole("Creation"))
                    {
                        @Html.ActionLink("My Drawings", "Create", "DesignChange", null, new { @class = "action" })
                        @Html.ActionLink("My Sheets", "Create", "DesignChange", null, new { @class = "action" })
                        @Html.ActionLink("My Design Changes", "Create", "DesignChange", null, new { @class = "action" })
                    }*@
                    @Html.ActionLink("My Personal Data", "DetailsFromUser", "Employee", new { id = Membership.GetUser().ProviderUserKey }, new { @class = "action" })
                </div>
            </div>
        }
        <div>
            <h3>
                <a href="#">Drawings</a></h3>
            <div>
                <fieldset>
                    <legend>Search for Drawing:</legend>
                    @using (Html.BeginForm("Index", "Drawing", FormMethod.Get))
                    {   <span class="display-label"> Identifier or name:</span> @Html.TextBox("search", null, new { @class = "searchTextBox" });
                        <input type="submit" value="Search" />
                    }
                </fieldset>
                @Html.ActionLink("Create New Drawing", "Create", "Drawing", null, new { @class = "action" })
                @Html.ActionLink("All Drawings", "Index", "Drawing", null, new { @class = "action" })
                <br />
            </div>
        </div>
        <div>
            <h3>
                <a href="#">Design Changes</a></h3>
            <div>
                <fieldset>
                    <legend>Search for Design Changes:</legend>
                    @using (Html.BeginForm("Index", "DesignChange", FormMethod.Get))
                    {                           
                        <span class="display-label">Title or Identifier:</span> @Html.TextBox("search", null, new { @class = "searchTextBox" });
                        <input type="submit" value="Search" />
                    }
                </fieldset>
                @Html.ActionLink("Create Design Change Request", "Create", "DesignChange", null, new { @class = "action" })
                @Html.ActionLink("All Design Changes", "Index", "DesignChange", null, new { @class = "action" })
                @Html.ActionLink("5 Newest Design Changes", "Newest", "DesignChange", new { amount = 5 }, new { @class = "action" })
                <br />
                <br />
                <fieldset>
                    <legend>Filter Design Changes by Phase:</legend>
                    <ul>
                        @foreach (DesignChangePhase item in ViewBag.Phases)
                        {
                            <li>
                                @Html.ActionLink(item.Name, "IndexByPhase", "DesignChange", new { id = item.PhaseID }, null)
                            </li>
                        }
                    </ul>
                </fieldset>
                @Html.ActionLink("Show Expired Design Changes", "ShowExpired", "DesignChange", null, new { @class = "action" })
            </div>
        </div>
        <div>
            <h3>
                <a href="#">Manufacturers</a></h3>
            <div>
                <fieldset>
                    <legend>Search for Manufacturer:</legend>
                    @using (Html.BeginForm("Index", "Manufacturer", FormMethod.Get))
                    {                           
                        <span class="display-label">Name:</span> @Html.TextBox("search", null, new { @class = "searchTextBox" });
                        <input type="submit" value="Search" />
                    }
                </fieldset>
                @Html.ActionLink("Create New Manufactuer", "Create", "Manufacturer", null, new { @class = "action" })
                @Html.ActionLink("All Manufacturers", "Index", "Manufacturer", null, new { @class = "action" })
                @Html.ActionLink("10 Newest Manufacturers", "Newest", "Manufacturer", new { amount = 10 }, new { @class = "action" })
            </div>
        </div>
        <div>
            <h3>
                <a href="#">Employees</a></h3>
            <div>
                @Html.ActionLink("Employee List", "Index", "Employee", null, new { @class = "action" })
                 @Html.ActionLink("Department List", "Department", "Employee", null, new { @class = "action" })
            </div>
        </div>
        @if (User.IsInRole("Administrator"))
        {
            <div>
                <h3>
                    <a href="#">Administration</a></h3>
                <div>
                    @Html.ActionLink("User Administration Panel", "Index", "UserAdministration", new { area = "MvcMembership" }, new { @class = "action" })
                    @Html.ActionLink("Maintenance", "DeleteUnusedRsx", "Drawing", null, new { @class = "action" })
                    @using (Html.BeginForm("Index", "UserAdministration", new { area = "MvcMembership" }, FormMethod.Get))
                    {
                        <fieldset>
                            <legend>Find a User</legend>
                            <label>
                                User Name or Email Address:
                                <input type="text" name="search" class="searchTextBox" />
                                <input type="submit" value="Search" />
                            </label>
                        </fieldset>
                    }
                </div>
            </div>
        }
    </div>
</div>
<div style="display: block; float: left; width: 30%">
    <h1 style="text-transform: none">
        Welcome to iDMS
    </h1>
    <span style="font-size: 19px">Providing a single, secure repository for design data,
        iDMS is integrated with all design software products. By storing designs in a centralized
        location, engineers can find, reference, and reuse that design data. </span>
    <div>
        @Html.ActionLink("About iDMS..", "About", null, new { @class = "action" })
    </div>
</div>
